import App from './App'
import Vue from 'vue'

//请求方法
import request from './utils/request.js'
Vue.prototype.$post = request.POST;
Vue.prototype.$get = request.GET;

// 注册全局组件
import navbar from "@/components/navbar.vue"
Vue.component('navbar', navbar)



Vue.prototype.$toast = (msg) => {
	uni.showToast({
		title: msg,
		icon: 'none'
	})
}

Vue.prototype.$model = (msg) => {
	return new Promise(function(resolve, reject) {
		uni.showModal({
			title: msg,
			success: function(res) {
				if (res.confirm) {
					resolve()
				} else if (res.cancel) {
					reject()
				}
			}
		})
	})
}

Vue.prototype.$loading = (msg) => {
	uni.showLoading({
		title: msg,
		mask: true
	})
}


Vue.config.productionTip = false

App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()